/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mvc_template_app.service;

import com.mvc_template_app.dao.LoginFormDao;
import com.mvc_template_app.model.LoginForm;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author kirilarsov
 */
@Service
public class TemplateAppServiceImpl implements TemplateAppService {

    @Autowired
    private LoginFormDao loginFormDao;

    @Transactional
    @Override
    public void saveLoginObject(LoginForm loginForm) {
        loginFormDao.saveLoginForm(loginForm);
    }

    
    @Transactional
    @Override
    public void deleteLoginObject(LoginForm loginForm) {
        loginFormDao.deleteLoginForm(loginForm);
    }

    @Transactional
    @Override
    public List<LoginForm> findByUsername(String username) {
        return loginFormDao.findByUsernameFromLoginForm(username);
    }
}
